import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
    {
        path: '/All',
        name: 'All',
        component: () => import("../views/All"),
        children: [
            // 商品
            {
                path: "goodsList",
                name: "goodsList",
                component: () => import("../components/goodsList")
            },
            {
                path: "addGoods",
                name: "addGoods",
                component: () => import("../components/addGoods")
            },
            {
                path: "upDateGoods/:_id",
                props:true,
                name: "upDateGoods",
                component: () => import("../components/upDateGoods")
            },
            // 商品分类
            {
                path: "goodsType",
                name: "goodsType",
                component: () => import("../components/goodsType")
            },
            // 订单
            {
                path: "order",
                name: "order",
                component: () => import("../components/order/list.vue")
            },
            {
                path: "order/1",
                name: "order",
                component: () => import("../components/order/list-1.vue")
            },
            {
                path: "order/2",
                name: "order",
                component: () => import("../components/order/list-2.vue")
            },
            {
                path: "order/3",
                name: "order",
                component: () => import("../components/order/list-3.vue")
            },
            // 订单统计
            {
                path: "orderCalculation",
                name: "orderCalculation",
                component: () => import("../components/orderCalculation")
            },
            // 广告幻灯片
            {
                path: "Ad",
                name: "Ad",
                component: () => import("../components/Ad")
            },
            //修改幻灯片
            {
                path: "AdChanged/:id",

                component: () => import("../components/AdChanged")
            },
            //广告幻灯片添加
            {
                path: "AddAd",
                name: "AddAd",
                component: () => import("../components/AddAd")
            },
            // 管理员列表
            {
                path: "adminList",
                name: "adminlist",
                component: () => import("../components/admin/adminList")
            },
            //管理员新增
            {
                path: "adminAdd",
                name: "adminAdd",
                component: () => import("../components/admin/adminAdd")
            },
            //管理员修改
            {
                path:'adminUpdata/:id',
                props:true,
                name:'adminupdata',
                component: () =>import('../components/admin/adminUpdata')
            },
            //文章列表
            {
                path:'articalList',
                name:'articallist',
                component:() =>import('../components/artical/articalList')
            },
            //文章新增
            {
                path:'articalAdd',
                name:'articaladd',
                component:() =>import('../components/artical/articalAdd')
            },
            //文章修改
            {
                path:'articalUpdata/:id',
                props:true,
                name:'articalupdata',
                component:() =>import('../components/artical/articalUpdata')
            }
        ]
    },
    {
        path: "/Login",
        name: "Login",
        component: () => import("../views/login")
    }
];

const router = new VueRouter({
    routes,
    mode: "history"
});

export default router;
